]> dgit.raspbian.org Git - gnome-shell.git/commit
breakManager: Make brightness setting function clearer
authorPhilip Withnall <pwithnall@gnome.org>
Wed, 2 Apr 2025 11:06:42 +0000 (12:06 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 11 Apr 2025 13:18:48 +0000 (13:18 +0000)
commit8f16cdff879f28acf084aa7c241843dedb0cce82
tree4e0ca84af8a21f34a064788f24a66752442f7c3c
parente280cc965164f388413e47bce23b9383e3d2d5ed
breakManager: Make brightness setting function clearer

Confusingly, the `brightness` property of
`ClutterBrightnessContrastEffect` has type `CoglColor`, but the
`set_brightness()` setter takes a single `float`.

We previously chose to use the property setter everywhere for
consistency (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655#note_2369353),
but didn’t realise the types don’t match.

GJS optimises `this._brightnessEffect.brightness = foo` into a call to
`clutter_brightness_contrast_effect_set_brightness()`, which means the
type mismatch between the two results in a warning (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280).

So, let’s change from a property setter into an explicit method call to
avoid the type ambiguity, at the expense of a bit of clarity from using
the same method to set the initial value and each property animation
step.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
js/misc/breakManager.js